package mall

import (
	"ginfast/app/mall/api"
	"ginfast/app/mall/model"
	"ginfast/pkg/ginx"
	"ginfast/pkg/orm"
)

// init 初始化
func init() {
	orm.RegisterModel(
		&model.User{},
		&model.UserAddress{},
		&model.Category{},
		&model.Goods{},
		&model.Order{},
		&model.Consumption{},
	)
	ginx.RegisterAuth("/v1/mall", func(r *ginx.RouterGroup) {
		r.Register("/category", api.Category{}.Routers)
		r.Register("/goods", api.User{}.Routers)
		r.Register("/user", api.Brand{}.Routers)
		r.Register("/user/addr", api.UserAddress{}.Routers)
		r.Register("/consumption", api.Consumption{}.Routers)
		r.Register("/order", api.Order{}.Routers)
	})
}
